package xiangmu;

public class KeChe extends Car {
    private int zuoweishu;
    public KeChe(String chepai, String pinpai, double rizujin,int zuoweishu) {
        super(chepai, pinpai, rizujin);
        this.zuoweishu=zuoweishu;
    }

    public int getZuoweishu() {
        return zuoweishu;
    }

    public void setZuoweishu(int zuoweishu) {
        this.zuoweishu = zuoweishu;
    }

    public  double jisuan(int day){
        if (day >= 3)
            return getRizujin() * day * 0.9;
        if (day >= 7)
            return getRizujin() * day * 0.8;

        if (day >= 30)
            return getRizujin() * day * 0.7;

        if (day >= 150)
            return getRizujin() * day * 0.6;

        return getRizujin() * day;

    }
    public void show() {
        System.out.print("车类型为客车，车牌号为"+getChepai()+"。日租金为："+getRizujin()+"，品牌为"+getPinpai()+"，车座位数为："+zuoweishu+"座。"+"当前状态为："+((getChuzuzhuangtai()==1)?"可出租":"已经出租"));
        System.out.println();
    }
}
